﻿using System;
using System.Web.Routing;

namespace Avalon.Core.Providers {

    public abstract class BaseProvider : IProvider {
        protected RequestContext _requestContext { get { return ContextProvider.RequestContext; } }

        /// <summary>
        /// The name of the requested action
        /// </summary>
        public string Action { get { return _requestContext.RouteData.Values["action"].ToString(); } }

        /// <summary>
        /// The name of the requested controller
        /// </summary>
        public string Controller { get { return _requestContext.RouteData.Values["controller"].ToString(); } }

        /// <summary>
        /// Reload the provider and run the settings
        /// </summary>
        public void Reload() { }
    }
}
